<?php
$this->headTitle('Quản trị', 'append');
?>
<div class="dashboard-menu dashboard-admin">
    <span class="back">&nbsp;</span>
    <h1>Quản trị</h1>
    
        <a class="btn btn-danger" href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'admin', 'action'=>'add'));?>">
            Thêm mới
        </a>
    
</div>
<div class="row placeholders">
    <div class="col-md-12">
        <div class="widget-big">
            <div class="table table-responsive">
                <div class="search-result text-left">
                    <table class="table table-bordetext-danger table-striped table-condensed table-hover" border="0" cellspacing="0" cellpadding="0">
                        <thead>
                            <tr class="warning">
                                <th style="width:10%">ID</th>
                                <th style="width:20%">Tên Đăng Nhập</th>                                
                                <th style="width:20%">Tên</th>
                                <th style="width:15%"><center>Avatar</center></th>
                                <th class="text-right" style="width:15%">Tình Trạng</th>
                                <th style="width:10%">Tài Khoản</th>
                                <th style="width:10%">Chức Năng</th>                                
                            </tr>
                        </thead>
                        <tbody>
                            <?php 
                                foreach ($this->adminList as $admin){
                            ?>
                            <tr>
                                <td style="width:10%"><?php echo $admin['id'];?></td>
                                <td style="width:20%">                                    
                                    <a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'admin', 'action'=>'edit', 'id'=>$admin['id']));?>" title="Sửa thông tin tài khoản">
                                        <?php echo $admin['username']; ?>
                                    </a>                                    
                                </td> 
                                <td style="width:20%"><?php echo $admin['fullname'];?></td>                               
                                <td style="width:15%">
                                    <center>
                                        <img class="avatar" src="<?php echo BASE_URL?>/<?=$admin['avatar']?>" style="width:40px;height:40px;" title="Hình đại diện" onerror="this.onerror=null;this.src='public/static/images/noimage.jpg';"/>
                                    </center>
                                </td>
                                <td class="text-right" style="width:15%">
                                    <?php echo ($admin['status'] == 1)? 'Đang Hoạt Động':'Bị khoá' ?>
                                </td>
                                <td style="width:10%">
                                    <?php echo ($admin['role'] == 1)? 'Quản trị':'Duyệt Tin' ?>
                                </td>
                                <td class="text-right" style="width:10%">                                        
                                    <a class="glyphicon glyphicon-pencil" href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'admin', 'action'=>'edit', 'id'=>$admin['id']));?>" title="Sửa thông tin">
                                    </a>&nbsp;&nbsp;                             
                        			<a class="glyphicon glyphicon-remove" href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'admin', 'action'=>'delete', 'id'=>$admin['id']));?>" title="Xóa người dùng">                                        
                                    </a>                                   
                                </td>
                            </tr>
                            <?php
                                } 
                            ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>